<?php 
	$host = "127.0.0.1";
	$userName = "root";
	$pwd = "root";
	$dbName = "text";
	$dbms='mysql';
	$dsn="$dbms:host=$host;dbname=$dbName";
	try {
		$db = new PDO($dsn,'root','root');
		//echo "连接成功。";
	} catch (Exception $exc) {
		//echo $exc->getMassage();
	}
	$db->query('set names utf8');
	$result = $db->query("SELECT * FROM `user` where `id` = ".$_POST["id"]);
	$result->setFetchMode(PDO::FETCH_ASSOC);
	while($row=$result->fetch()){
		if($row['pwd']==$_POST["pwd"]){
			if($row['isTea']==1){
				$str = '1';
			}elseif($row['isTea']==0){
				$str = '0';
			}
		}
		else{
			$str = '2';
		}
	}
	exit($str);
?>